package com.book.service;

import com.book.dao.adminDao;
import com.book.po.Admin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class adminService {
    @Autowired
    private adminDao adminDao;

    public Admin login(Admin admin) {
        return adminDao.login(admin);
    }

    public List<Admin> admin_select(Admin admin) {
        return adminDao.admin_select(admin);
    }


    public String admin_update(Admin admin) {
        if (adminDao.admin_update(admin) != 0) {
            return "修改成功";
        } else {
            return "修改失败";
        }
    }
    public String admin_insert(Admin admin){
        if (adminDao.admin_insert(admin) != 0) {
            return "添加成功";
        } else {
            return "添加失败";
        }
    }

    public String admin_delete(Integer aid) {
        if (adminDao.admin_delete(aid) != 0) {
            return "删除成功";
        } else {
            return "删除失败";
        }
    }


}
